package com.taiji.dicom4cloud.smart.alarm.config;

import com.taiji.dicom4cloud.smart.alarm.handler.*;
import com.taiji.dicom4cloud.smart.alarm.manager.MessageStrategyManager;
import com.taiji.dicom4cloud.smart.alarm.socket.ServerSocketConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description
 * @Author fanxl
 * @Date 2021/7/21
 **/
@Configuration
public class AlarmConfig {

    @Bean
    @ConditionalOnMissingBean
    public MessageStrategyManager messageStrategyManager(){
        return new MessageStrategyManager();
    }

    @Bean
    @ConditionalOnMissingBean
    public StartHandler startHandler(){
        return new StartHandler();
    }


    @Bean
    @ConditionalOnMissingBean
    public ResetHandler resetHandler(){
        return new ResetHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public OperationHandler operationHandler(){
        return new OperationHandler();
    }


    @Bean
    @ConditionalOnMissingBean
    public DoStatusHandler doStatusHandler(){
        return new DoStatusHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public AlarmHandler alarmHandler(){
        return new AlarmHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public BreakDownHandler breakDownHandler(){
        return new BreakDownHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public NormalHandler normalHandler(){
        return new NormalHandler();
    }
    @Bean
    @ConditionalOnMissingBean
    public RealDataHandler realDataHandler(){
        return new RealDataHandler();
    }
    @Bean
    @ConditionalOnMissingBean
    public MalignantAlarmHandler malignantAlarmHandler(){
        return new MalignantAlarmHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public AlarmRecoveryHandler alarmRecoveryHandler(){
        return new AlarmRecoveryHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public BreakDownRecoveryHandler breakDownRecoveryHandler(){
        return new BreakDownRecoveryHandler();
    }


    @Bean
    @ConditionalOnMissingBean
    public BadLoadHandler badLoadHandler(){
        return new BadLoadHandler();
    }
    @Bean
    @ConditionalOnMissingBean
    public UnKnowHandler unKnowHandler(){
        return new UnKnowHandler();
    }

    @Bean
    @ConditionalOnMissingBean
    public MessageStrategyManager getMessageStrategyManager(){
        return new MessageStrategyManager();
    }
    @Bean
    @ConditionalOnMissingBean
    public ServerSocketConfig getServerSocketConfig(){
        ServerSocketConfig serverSocketConfig = new ServerSocketConfig();
        return serverSocketConfig;
    }
}
